#{extends 'main.html' /}
#{set title:'All Departments' /}

<table class="data">
	<tr>
		<th width="50">Id</th>
		<th>Department Name</th>
		<th>Address</th>
		<th>Department Manager</th>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
	</tr>

	#{list items:entities, as:'entity'}
	<tr>
		<td>${entity.id}</td>
		<td>${entity.name}</td>
		<td>${entity.address}</td>
		<td>${entity.departmentManager}</td>
		<td class="edit"><a href="@{Departments.edit(entity.id)}">Edit</a></td>
		<td class="edit"><a href="@{Departments.allDepartmentEmployees(entity.id)}">Employees</a></td>
		<td class="delete"><a href="@{Departments.delete(entity.id)}"
			onclick="if (!confirm('Are you sure you want to delete this record?')) return false;">Delete</a>
		</td>
	</tr>
	#{/list}
</table>
<br/>
<a href="@{Departments.create}">Add</a>
